package com.efuture.vdrp.android.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class GoodsListServlets extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html");
		request.setCharacterEncoding("gbk");
		response.setCharacterEncoding("gbk");
		PrintWriter out = response.getWriter();
		ArrayList<String> list=new ArrayList<String>();
		MySQL sql=new MySQL();
		list=sql.select_m_s_good_is();
		sql.close();
		int size=list.size();
		
	   StringBuilder sb=new StringBuilder();
		for(int i=0;i<size;i++){
			sb.append(sql.select_goods_name(Integer.parseInt(list.get(i))));
			sb.append(",");
			
			
		}
		out.println(sb.toString());
	}
		

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

}
